﻿@model LoginEditModel
@{
    Layout = "_Account";
    bool canRegister = ViewData.Get<bool>("CanRegister", true);
}
<style type="text/css">
    .tn-form .tn-form-label {
        height: 40px;
        line-height: 40px;
    }

    .tn-textbox {
        height: 23px;
    }
    .btn-normal { font-size: 18px; height: 42px; padding: 0 20px; line-height: 40px; }
    .btn-red { color: #fff; background: #eb282e; }
    .formbtn { display: block; border: none; font-weight: normal; vertical-align: middle; border-radius: 3px; cursor: pointer; -webkit-font-smoothing: subpixel-antialiased; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; transition: border .25s linear, color .25s linear, background-color .25s linear; }
    .form-width{ width:270px;}
    .form-control { border: 1px solid #e2e2e2; color: #555; box-shadow: inset 1px 1px 3px #f5f5f5; font-size: 15px; background-color: #fff; line-height: 1.467; padding: 8px 12px; height: 25px; -webkit-appearance: none; border-radius: 3px; -webkit-transition: border .25s linear, color .25s linear, background-color .25s linear; transition: border .25s linear, color .25s linear, background-color .25s linear; }
</style>
<div class="tn-box tn-widget tn-widget-content tn-corner-all tnc-login">
    <div class="tn-box-content tn-widget-content tn-corner-all">
        <div class="tnc-login-wrap tn-helper-clearfix">
            @*<div class="tn-main-heading tn-border-gray tn-border-bottom">
                <h2>
                    登录
                </h2>
            </div>*@
            @if (ViewData["PresetMessage"] != null && ViewData["StatusMessage"] == null)
            {
                @Html.PresetMessage(ViewData["PresetMessage"] as string, true)
            }
            <div class="tnc-login-directly">
                @if (canRegister)
                {
                    <div class="tnc-have-id">
                        <p>
                            我还没有帐号：
                        </p>
                        <p>
                            @Html.LinkButton("立即注册", SiteUrls.Instance().Register(Model.ReturnUrl), HighlightStyles.Primary, htmlAttributes: new { tabindex = "-1" })
                        </p>
                    </div>
                }
                <div class="tnc-third-id-login @(canRegister ? "tn-border-gray tn-border-top" : "")">
                    <p>
                        使用第三方帐号登录
                    </p>
                    <p>
                        @foreach (var accountType in new AccountBindingService().GetAccountTypes(true))
                        {
                            <a href="javascript:;" onclick="window.open('@SiteUrls.Instance().LoginToThird(accountType.AccountTypeKey)', 'ThirdLogin', 'width=600,height=500,menubar=0,scrollbars=0, status=1,titlebar=0,toolbar=0,location=1'); return false;">
                                <img src="@SiteUrls.Instance().ThirdLoginButtonUrl(accountType.AccountTypeKey)" alt="使用第三方帐号登录" />
                            </a>
                        }
                    </p>
                </div>
            </div>
            @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { @class = "tn-helper-flowfix" }))
            {
                <div class="tn-form tn-label-right  tn-border-gray tn-border-right">
                    @Html.StatusMessage(ViewData["StatusMessage"] as StatusMessageData)
                    <div class="tn-form-row tn-account" style="height: 48px;">
                        @Html.FormLabelFor(n => n.UserName)
                        @Html.TextBoxFor(n => n.UserName, new { @class = "form-control form-width", placeholder = "账号" })
                        @Html.ValidationMessageFor(n => n.UserName)
                    </div>
                    <div class="tn-form-row tn-password" style="height: 48px;">
                        @Html.FormLabelFor(n => n.Password)
                        @Html.TextBoxFor(n => n.Password, new { @class = "form-control form-width", placeholder = "账号密码", @type = "password" })
                        @Html.ValidationMessageFor(n => n.Password)
                    </div>
                    @Html.Captcha(VerifyScenarios.Login, true)
                    <div class="tn-form-row tn-func tn-helper-clearfix" >
                        <span class="tn-remember">
                            @Html.CheckBoxFor(n => n.RememberPassword, new { @class = "tn-checkbox" })
                            @Html.LabelFor(n => n.RememberPassword)
                            @Html.ValidationMessageFor(n => n.RememberPassword)
                        </span><span class="tn-forgot">
                            @Html.Link("找回密码", SiteUrls.Instance().FindPassword(), "找回密码")
                        </span>
                    </div>
                   
                    @Html.HiddenFor(n => n.ReturnUrl)
                    <div class="tn-form-row tn-form-row-button">
                        <button type="submit" id="msn" class="formbtn btn-normal btn-red submit form-width">登录</button>
                    </div>
                </div>
            }
        </div>
    </div>
</div>
